# pyinstaller -F main.py
import hashlib
import os.path

while True:

    filename = input("鼠标拖入需要查询MD5码的文件：")
    if os.path.isfile(filename):
      fp=open(filename,'rb')
      contents=fp.read()
      fp.close()
      print("\n" + hashlib.md5(contents).hexdigest())
    else:
      print('file not exists')
    print("")